package com.taiji.workOrder.service.impl;

import java.util.List;
import com.taiji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.taiji.workOrder.mapper.OrderEnclosureMapper;
import com.taiji.workOrder.domain.OrderEnclosure;
import com.taiji.workOrder.service.IOrderEnclosureService;

/**
 * 工单附件Service业务层处理
 * 
 * @author taiji
 * @date 2023-03-09
 */
@Service
public class OrderEnclosureServiceImpl implements IOrderEnclosureService 
{
    @Autowired
    private OrderEnclosureMapper orderEnclosureMapper;

    /**
     * 查询工单附件
     * 
     * @param id 工单附件主键
     * @return 工单附件
     */
    @Override
    public OrderEnclosure selectOrderEnclosureById(Long id)
    {
        return orderEnclosureMapper.selectOrderEnclosureById(id);
    }

    /**
     * 查询工单附件列表
     * 
     * @param orderEnclosure 工单附件
     * @return 工单附件
     */
    @Override
    public List<OrderEnclosure> selectOrderEnclosureList(OrderEnclosure orderEnclosure)
    {
        return orderEnclosureMapper.selectOrderEnclosureList(orderEnclosure);
    }

    /**
     * 新增工单附件
     * 
     * @param orderEnclosure 工单附件
     * @return 结果
     */
    @Override
    public int insertOrderEnclosure(OrderEnclosure orderEnclosure)
    {
        orderEnclosure.setCreateTime(DateUtils.getNowDate());
        return orderEnclosureMapper.insertOrderEnclosure(orderEnclosure);
    }

    /**
     * 修改工单附件
     * 
     * @param orderEnclosure 工单附件
     * @return 结果
     */
    @Override
    public int updateOrderEnclosure(OrderEnclosure orderEnclosure)
    {
        orderEnclosure.setUpdateTime(DateUtils.getNowDate());
        return orderEnclosureMapper.updateOrderEnclosure(orderEnclosure);
    }

    /**
     * 批量删除工单附件
     * 
     * @param ids 需要删除的工单附件主键
     * @return 结果
     */
    @Override
    public int deleteOrderEnclosureByIds(Long[] ids)
    {
        return orderEnclosureMapper.deleteOrderEnclosureByIds(ids);
    }

    /**
     * 删除工单附件信息
     * 
     * @param id 工单附件主键
     * @return 结果
     */
    @Override
    public int deleteOrderEnclosureById(Long id)
    {
        return orderEnclosureMapper.deleteOrderEnclosureById(id);
    }
}
